#define _CRT_SECURE_NO_WARNINGS 1


#include<algorithm>
#include<vector>
#include<iostream>

using namespace std;

int MoreThanHalfNum_Solution(vector<int>& numbers)
{
	int size = numbers.size();
	if (size == 1)
	{
		return numbers[0];
	}
	sort(numbers.begin(), numbers.end());
	int begin = 0, end = 1;
	while (end < size)
	{
		if (numbers[begin] != numbers[end])
		{
			if (end - begin > size / 2)
			{
				return numbers[begin];
			}
			begin = end;
		}
		end++;
	}
	return numbers[begin];
}